package org.pine.dictionary.bean.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.pine.dictionary.bean.BaseQueryRequest;
import org.pine.dictionary.common.StatusEnum;

import javax.validation.constraints.NotBlank;
import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 字典查询请求体
 * </p>
 *
 * @author pine
 * @since 2024-05-16
 */
@EqualsAndHashCode(callSuper = true)
@Schema(title = "字典查询请求体")
@ToString(callSuper = true)
@Data
public class DictionaryQueryRequest extends BaseQueryRequest implements Serializable {
    @Serial
    private static final long serialVersionUID = 7209056815371124806L;

    /**
     * 字典ID
     */
    @JsonProperty("dictionaryId")
    @Schema(title = "dictionaryId", description = "字典ID")
    private String dictionaryId;

    /**
     * 编码
     */
    @NotBlank(message = "编码不能为空")
    @Schema(title = "code", description = "编码")
    private String code;

    /**
     * 名称
     */
    @Schema(title = "name", description = "名称")
    private String name;

    /**
     * 状态: 1=启用，0=禁用
     * @see StatusEnum
     */
    @JsonSerialize(using = StatusEnum.JsonSerializer.class)
    @JsonDeserialize(using = StatusEnum.JsonDeserializer.class)
    @Schema(title = "status", description = "状态: 1=启用，0=禁用")
    private StatusEnum status;
}
